package xyz.apiote.fruchtfleisch

import org.junit.jupiter.api.Test

data class C(var x: Byte = 0)

internal class ReflectReaderTest {

	@Test
	fun readInt() {
		val b = byteArrayOf(0x02)
		var i: Byte = 0
		i = readClass(i, b.inputStream()) as Byte
		assert(i.toInt() == 2)
	}

	@Test
	fun readClass() {
		val b = byteArrayOf(0x02)
		val i = C()
		readClass(i, b.inputStream())
		assert(i.x.toInt() == 2)
	}
}